package com.newtouch.krd_app.http.model;

import android.app.Application;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.gson.JsonSyntaxException;
import com.hjq.gson.factory.GsonFactory;
import com.hjq.http.EasyLog;
import com.hjq.http.config.IRequestHandler;
import com.hjq.http.exception.CancelException;
import com.hjq.http.exception.DataException;
import com.hjq.http.exception.FileMD5Exception;
import com.hjq.http.exception.HttpException;
import com.hjq.http.exception.NetworkException;
import com.hjq.http.exception.NullBodyException;
import com.hjq.http.exception.ResponseException;
import com.hjq.http.exception.ServerException;
import com.hjq.http.exception.TimeoutException;
import com.hjq.http.request.HttpRequest;
import com.newtouch.krd_app.R;
import com.newtouch.krd_app.http.exception.ResultException;
import com.newtouch.krd_app.http.exception.TokenException;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.Type;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;

import okhttp3.Headers;
import okhttp3.Response;
import okhttp3.ResponseBody;

/**
 *    author : TQ
 *    time   : 2023/02/13
 *    desc   : 请求处理类
 */
public final class RequestHandler implements IRequestHandler {

    private final Application mApplication;

    public RequestHandler(Application application) {
        mApplication = application;
    }

    @NonNull
    @Override
    public Object requestSucceed(@NonNull HttpRequest<?> httpRequest, @NonNull Response response,
                                 @NonNull Type type) throws Exception {
        if (Response.class.equals(type)) {
            return response;
        }

        if (!response.isSuccessful()) {
            throw new ResponseException(String.format(mApplication.getString(R.string.http_response_error),
                    response.code(), response.message()), response);
        }

        if (Headers.class.equals(type)) {
            return response.headers();
        }

        ResponseBody body = response.body();
        if (body == null) {
            throw new NullBodyException(mApplication.getString(R.string.http_response_null_body));
        }

        if (ResponseBody.class.equals(type)) {
            return body;
        }

        // 如果是用数组接收，判断一下是不是用 byte[] 类型进行接收的
        if(type instanceof GenericArrayType) {
            Type genericComponentType = ((GenericArrayType) type).getGenericComponentType();
            if (byte.class.equals(genericComponentType)) {
                return body.bytes();
            }
        }

        if (InputStream.class.equals(type)) {
            return body.byteStream();
        }

        if (Bitmap.class.equals(type)) {
            return BitmapFactory.decodeStream(body.byteStream());
        }

        String text;
        try {
            text = body.string();
        } catch (IOException e) {
            // 返回结果读取异常
            throw new DataException(mApplication.getString(R.string.http_data_explain_error), e);
        }

        // 打印这个 Json 或者文本
        EasyLog.printJson(httpRequest, text);

        if (String.class.equals(type)) {
            return text;
        }

        final Object result;
        text = "{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"materialId\":368,\"terminalId\":236,\"fileId\":\"8ac1d3f83e8a4903887fe581a87db1d7,75442a9c9bc34b768f8e8c2019061123,ff072e4993d84b96aa3bc2badc65aec3,f8f51ce6a3a244d9bf4abc10ec9d9250,926e306024114d548afcc7445a46d3e6\",\"files\":[{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 14:59:43\",\"params\":{},\"fileId\":\"8ac1d3f83e8a4903887fe581a87db1d7\",\"fileName\":\"人员分工.png\",\"fileType\":\"png\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/12/rBDYiWPp396AfqxgAAPMk7ZprMY557.png\",\"fileSize\":248979.00,\"delFlag\":\"0\"},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:36\",\"params\":{},\"fileId\":\"75442a9c9bc34b768f8e8c2019061123\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）.pdf\",\"fileType\":\"pdf\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4E-APnJHAIN4DYD5wWE434.pdf\",\"fileSize\":8615949.00,\"delFlag\":\"0\",\"picFiles\":[{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:10\",\"remark\":\"1\",\"params\":{},\"fileId\":\"3395544966f1424db2a7389f27687e49\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_1.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DWAX85JAAJYye3N0aQ547.jpg\",\"fileSize\":153801.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:10\",\"remark\":\"2\",\"params\":{},\"fileId\":\"56d9ec413b584bf5a4cad32aa59695c9\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_2.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DaAaOrHAAYAkesJeGU169.jpg\",\"fileSize\":393361.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:11\",\"remark\":\"3\",\"params\":{},\"fileId\":\"3b41b292026c4c33a1a0a3ea74be03b5\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_3.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DaAVURhAAXl_HSMsqA998.jpg\",\"fileSize\":386556.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:11\",\"remark\":\"4\",\"params\":{},\"fileId\":\"76217f122c0c4e4ba7c1c89b869fa33b\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_4.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DeATHDWAAVnQdBS6Is188.jpg\",\"fileSize\":354113.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:12\",\"remark\":\"5\",\"params\":{},\"fileId\":\"a02e54c262b24be3a98e876802629766\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_5.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DiAIGLOAASnF8jYY7Y345.jpg\",\"fileSize\":304919.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:13\",\"remark\":\"6\",\"params\":{},\"fileId\":\"9fd628ac17064f6aac04053ffb5f5473\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_6.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DiANU0wAATmZhSEDNg773.jpg\",\"fileSize\":321126.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:13\",\"remark\":\"7\",\"params\":{},\"fileId\":\"6a0a653318c94877afbb6f5cee1b2a6f\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_7.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DiAAXptAATr_QLCLTU932.jpg\",\"fileSize\":322557.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:14\",\"remark\":\"8\",\"params\":{},\"fileId\":\"524db4c9cc2a4fb49919b5dff57bbb09\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_8.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DmAaakGAAWFeBe2Wa0148.jpg\",\"fileSize\":361848.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:14\",\"remark\":\"9\",\"params\":{},\"fileId\":\"b475388c44a4488c958cea18ec59689f\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_9.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DqARHJwAAXyqJCX5f4258.jpg\",\"fileSize\":389800.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:15\",\"remark\":\"10\",\"params\":{},\"fileId\":\"7a88415d43c24fd5bfd2814d57e09416\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_10.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DqALV-aAAZ_KNIpy7U706.jpg\",\"fileSize\":425768.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:15\",\"remark\":\"11\",\"params\":{},\"fileId\":\"308fa11bcb9746c1922cd05ff16e8a99\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_11.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DuAM8HFAAUIXCPBu8Y016.jpg\",\"fileSize\":329820.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:16\",\"remark\":\"12\",\"params\":{},\"fileId\":\"86c099607529446dbb968d033562735f\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_12.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DuAdQc_AAT1yyj6u5g950.jpg\",\"fileSize\":325067.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:16\",\"remark\":\"13\",\"params\":{},\"fileId\":\"9501a9acda62439db28794a0f72b793f\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_13.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DyAVbvMAAaHzQnqb0M051.jpg\",\"fileSize\":427981.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:17\",\"remark\":\"14\",\"params\":{},\"fileId\":\"59dfd7ed56ab49d388c1d95f8684b405\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_14.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4DyABVQ9AAUGD3oEO1U990.jpg\",\"fileSize\":329231.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:17\",\"remark\":\"15\",\"params\":{},\"fileId\":\"e49332c1f31d45198aafa0d7adaa32e6\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_15.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4D2AeA53AAUqTdFwlBA087.jpg\",\"fileSize\":338509.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:18\",\"remark\":\"16\",\"params\":{},\"fileId\":\"1ddd4439fe1346d4be566b3ebb7fb81a\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_16.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4D2AUQ7tAAS-va_HNSM512.jpg\",\"fileSize\":310973.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:18\",\"remark\":\"17\",\"params\":{},\"fileId\":\"79405fa4c05c422fb50f5eac420e7fe0\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_17.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4D6AcWwDAAUba63OLYw044.jpg\",\"fileSize\":334699.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:19\",\"remark\":\"18\",\"params\":{},\"fileId\":\"a8b7723f6359442d9a7d40a0d633a604\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_18.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4D6AC_xlAAWzhFLKwXg774.jpg\",\"fileSize\":373636.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:19\",\"remark\":\"19\",\"params\":{},\"fileId\":\"24d0be3b359246188d2f054442352355\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_19.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4D-AFohgAAW-qG5bAJg460.jpg\",\"fileSize\":376488.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:20\",\"remark\":\"20\",\"params\":{},\"fileId\":\"ed77846cfe9e4b81a3d865af431f7956\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_20.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4ECAHZZhAAT8bLQsej0239.jpg\",\"fileSize\":326764.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:21\",\"remark\":\"21\",\"params\":{},\"fileId\":\"e7253b42c7f145d78e3c5da4314e9e07\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_21.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4ECALe2mAAWm87aS_u4072.jpg\",\"fileSize\":370419.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:21\",\"remark\":\"22\",\"params\":{},\"fileId\":\"ac574391c4a44c76b83049594d731b26\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_22.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EGAe_eaAATVc-nrxXU392.jpg\",\"fileSize\":316787.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:22\",\"remark\":\"23\",\"params\":{},\"fileId\":\"6019904295bb430f96ba1be591ce6ea9\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_23.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EGADL34AAVSM8j5HtA676.jpg\",\"fileSize\":348723.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:22\",\"remark\":\"24\",\"params\":{},\"fileId\":\"ff4020dcacc543ac863595b8ded6740a\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_24.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EKATcoRAASvVr1Etm0209.jpg\",\"fileSize\":307030.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:23\",\"remark\":\"25\",\"params\":{},\"fileId\":\"063630cc2a6042c5a7b80929942fdb2a\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_25.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EKAJODRAAXnreCe0v0486.jpg\",\"fileSize\":386989.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:23\",\"remark\":\"26\",\"params\":{},\"fileId\":\"aba40f542d7444c19a01d9974a8958ee\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_26.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EOAfxwSAAWPtCZDrhw484.jpg\",\"fileSize\":364468.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:24\",\"remark\":\"27\",\"params\":{},\"fileId\":\"275057fd03cd426c80c17dbf35fd19bf\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_27.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EOAcZF2AAXDJygzoVw553.jpg\",\"fileSize\":377639.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:25\",\"remark\":\"28\",\"params\":{},\"fileId\":\"f5499dc574eb441583a78eddf6ed5d3d\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_28.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4ESAJCcEAAZ7s4dAd38701.jpg\",\"fileSize\":424883.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:25\",\"remark\":\"29\",\"params\":{},\"fileId\":\"7631392051014752889218672ef6e2da\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_29.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EWAc7uDAAWCxkGdXKw648.jpg\",\"fileSize\":361158.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:26\",\"remark\":\"30\",\"params\":{},\"fileId\":\"d5ab886f6b81403c91fa058bdaf8750a\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_30.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EWAPe6EAAXx4gieuFs822.jpg\",\"fileSize\":389602.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:26\",\"remark\":\"31\",\"params\":{},\"fileId\":\"cada339ff81241fb96e0ae08b07c5ad1\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_31.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EaADGjEAASrmSbS708209.jpg\",\"fileSize\":306073.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:27\",\"remark\":\"32\",\"params\":{},\"fileId\":\"d0170fb5f2ca488fbc89a402669d37d4\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_32.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EaAFW8HAAY94BGca_8137.jpg\",\"fileSize\":409056.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:27\",\"remark\":\"33\",\"params\":{},\"fileId\":\"c9c131302e1e45808661b01c5c8cd06c\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_33.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EeADJIFAAVeoY8D9HM891.jpg\",\"fileSize\":351905.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:28\",\"remark\":\"34\",\"params\":{},\"fileId\":\"08fa7ec5bb644b8eb822e5ce1860e325\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_34.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EeAcdiHAAXcF__TUew707.jpg\",\"fileSize\":384023.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:28\",\"remark\":\"35\",\"params\":{},\"fileId\":\"d347ba2ce17642b6babb2be53689a215\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_35.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EiAMN5tAAUu6ks-72s148.jpg\",\"fileSize\":339690.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:29\",\"remark\":\"36\",\"params\":{},\"fileId\":\"3224dc3469144840b73065503ed70d24\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_36.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EiASJ2QAAXI3p-Wy4A425.jpg\",\"fileSize\":379102.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:29\",\"remark\":\"37\",\"params\":{},\"fileId\":\"11a940eb0e05407a92d7992833e4477b\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_37.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EmAPSHHAAVXus6Gd6g617.jpg\",\"fileSize\":350138.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:30\",\"remark\":\"38\",\"params\":{},\"fileId\":\"19b276a0aa284d269c4ff5799a452663\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_38.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EmAU45mAAStpD7VOaY548.jpg\",\"fileSize\":306596.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:30\",\"remark\":\"39\",\"params\":{},\"fileId\":\"f3c7653cb1664b7882722004a73332eb\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_39.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EqAOe98AAUmFqPaGSI021.jpg\",\"fileSize\":337430.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:31\",\"remark\":\"40\",\"params\":{},\"fileId\":\"7763e5b089c249cd827539eb2c1f0829\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_40.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EqAIO_OAAWVIDiuRgI392.jpg\",\"fileSize\":365856.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:31\",\"remark\":\"41\",\"params\":{},\"fileId\":\"435345e3f2f34ad59efcae0ca6c2c2ba\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_41.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EuALsgAAAWhJz55Qww685.jpg\",\"fileSize\":368935.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:32\",\"remark\":\"42\",\"params\":{},\"fileId\":\"11e19eff427140c29e424ded122098b4\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_42.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EuAW6PlAAWrb98n5Mw497.jpg\",\"fileSize\":371567.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:32\",\"remark\":\"43\",\"params\":{},\"fileId\":\"8503aa89d7ab4d6f9684a00b086a40a7\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_43.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EyARCukAAT6B_-WQSI098.jpg\",\"fileSize\":326151.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:33\",\"remark\":\"44\",\"params\":{},\"fileId\":\"cead4df2e4124c87bd7e1c322466b0ad\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_44.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4EyAeigQAAVCvlaY1Qo065.jpg\",\"fileSize\":344766.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:33\",\"remark\":\"45\",\"params\":{},\"fileId\":\"70f5cdbf6af649a9b0c8c9946561b4c6\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_45.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4E2AAaCFAAXpWUWQVQ8984.jpg\",\"fileSize\":387417.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:34\",\"remark\":\"46\",\"params\":{},\"fileId\":\"d245aa981ebe4fa8aea436991049eeb5\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_46.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4E2ALbGbAAQeSS_RQYE467.jpg\",\"fileSize\":269897.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:35\",\"remark\":\"47\",\"params\":{},\"fileId\":\"4739d30ac0434523a910c1f4061bb113\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_47.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4E6AFbvgAAXCnLi6YEA629.jpg\",\"fileSize\":377500.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:35\",\"remark\":\"48\",\"params\":{},\"fileId\":\"d9300bc780724d9ca0d89148809941ef\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_48.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4E-ARJcOAAUjnAwX1pI851.jpg\",\"fileSize\":336796.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:35\",\"remark\":\"49\",\"params\":{},\"fileId\":\"a1ccceb147ba4fa384b9dd0d9caf0953\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_49.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4E-APIm5AAVZiTLQGVg054.jpg\",\"fileSize\":350601.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:36\",\"remark\":\"50\",\"params\":{},\"fileId\":\"627b76c80e064bccb176f76e401d02dc\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_50.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4E-AWFN2AAUnmf3P1Y8167.jpg\",\"fileSize\":337817.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666}]},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:55\",\"params\":{},\"fileId\":\"ff072e4993d84b96aa3bc2badc65aec3\",\"fileName\":\"人员分工.xlsx\",\"fileType\":\"xlsx\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4GKAJZ7tAANnwh64nHo11.xlsx\",\"fileSize\":223170.00,\"delFlag\":\"0\"},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:02:06\",\"params\":{},\"fileId\":\"f8f51ce6a3a244d9bf4abc10ec9d9250\",\"fileName\":\"安全融媒体需求及备注说明.docx\",\"fileType\":\"docx\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4G6AHOR1AAdHI3-cHS093.docx\",\"fileSize\":476963.00,\"delFlag\":\"0\"},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:08:07\",\"params\":{},\"fileId\":\"926e306024114d548afcc7445a46d3e6\",\"fileName\":\"111222333.mp4\",\"fileType\":\"mp4\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4daAFcxnA30wVdFXi88193.mp4\",\"fileSize\":58536021.00,\"delFlag\":\"0\"}]}}";
//        text = "{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"fileId\":\"e5c9225d37c243c1875dcb9b292cf79a,2736b5eccbb34e67a5bcaac2e7d155c8\",\"files\":[{\"createBy\":\"softmedia\",\"createTime\":1677489254000,\"delFlag\":\"0\",\"fileId\":\"e5c9225d37c243c1875dcb9b292cf79a\",\"fileName\":\"2.pdf\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/19/rBDYiWP8dGaAIZZaAAOqgUa3doo563.pdf\",\"fileSize\":240257.00,\"fileType\":\"pdf\",\"params\":{},\"picFiles\":[{\"createBy\":\"softmedia\",\"createTime\":1677489254000,\"delFlag\":\"0\",\"fileId\":\"d2e14829b866495fbb47c4a29c36bd5a\",\"fileName\":\"2_1.jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/19/rBDYiWP8dGaATqEFAAMr5sXO9ac618.jpg\",\"fileSize\":207846.00,\"fileType\":\"jpg\",\"height\":2338,\"params\":{},\"remark\":\"1\",\"width\":1653}]},{\"createBy\":\"softmedia\",\"createTime\":1677489259000,\"delFlag\":\"0\",\"fileId\":\"2736b5eccbb34e67a5bcaac2e7d155c8\",\"fileName\":\"223232323232323232323.jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/19/rBDYiWP8dGqADIjOACE0D8nTxQw033.jpg\",\"fileSize\":2176015.00,\"fileType\":\"jpg\",\"params\":{}}],\"materialId\":376,\"terminalId\":387}}";
//         text  = "{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"fileId\":\"93bac4bca5194d94b5bcaf1cc5275b42,b51e54fc52e548c992b89e1ad5d05b84\",\"files\":[{\"createBy\":\"softmedia\",\"createTime\":1677484693000,\"delFlag\":\"0\",\"fileId\":\"93bac4bca5194d94b5bcaf1cc5275b42\",\"fileName\":\"220kV三圣变电站-220kV金融城变电站线路新建工程-电缆(2)(1)(1)(1).xlsx\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/18/rBDYiWP8YpSADFdXACHdlwi73aY59.xlsx\",\"fileSize\":2219415.00,\"fileType\":\"xlsx\",\"params\":{}},{\"createBy\":\"softmedia\",\"createTime\":1677484696000,\"delFlag\":\"0\",\"fileId\":\"b51e54fc52e548c992b89e1ad5d05b84\",\"fileName\":\"223232323232323232323.jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/18/rBDYiWP8YpeARZWpACE0D8nTxQw157.jpg\",\"fileSize\":2176015.00,\"fileType\":\"jpg\",\"params\":{}}],\"materialId\":374,\"terminalId\":387}}";
//         text  = "{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"materialId\":368,\"terminalId\":236,\"fileId\":\"8ac1d3f83e8a4903887fe581a87db1d7,75442a9c9bc34b768f8e8c2019061123,ff072e4993d84b96aa3bc2badc65aec3,f8f51ce6a3a244d9bf4abc10ec9d9250,926e306024114d548afcc7445a46d3e6\",\"files\":[{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 14:59:43\",\"params\":{},\"fileId\":\"8ac1d3f83e8a4903887fe581a87db1d7\",\"fileName\":\"人员分工.png\",\"fileType\":\"png\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/12/rBDYiWPp396AfqxgAAPMk7ZprMY557.png\",\"fileSize\":248979.00,\"delFlag\":\"0\"},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:36\",\"params\":{},\"fileId\":\"75442a9c9bc34b768f8e8c2019061123\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）.pdf\",\"fileType\":\"pdf\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4E-APnJHAIN4DYD5wWE434.pdf\",\"fileSize\":8615949.00,\"delFlag\":\"0\",\"picFiles\":[{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:10\",\"remark\":\"1\",\"params\":{},\"fileId\":\"3395544966f1424db2a7389f27687e49\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_1.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DWAX85JAAJYye3N0aQ547.jpg\",\"fileSize\":153801.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:10\",\"remark\":\"2\",\"params\":{},\"fileId\":\"56d9ec413b584bf5a4cad32aa59695c9\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_2.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DaAaOrHAAYAkesJeGU169.jpg\",\"fileSize\":393361.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:11\",\"remark\":\"3\",\"params\":{},\"fileId\":\"3b41b292026c4c33a1a0a3ea74be03b5\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_3.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DaAVURhAAXl_HSMsqA998.jpg\",\"fileSize\":386556.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:11\",\"remark\":\"4\",\"params\":{},\"fileId\":\"76217f122c0c4e4ba7c1c89b869fa33b\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_4.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DeATHDWAAVnQdBS6Is188.jpg\",\"fileSize\":354113.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:11\",\"remark\":\"4\",\"params\":{},\"fileId\":\"76217f122c0c4e4ba7c1c89b869fa33b\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_4.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DeATHDWAAVnQdBS6Is188.jpg\",\"fileSize\":354113.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:11\",\"remark\":\"4\",\"params\":{},\"fileId\":\"76217f122c0c4e4ba7c1c89b869fa33b\",\"fileName\":\"【让现场更安全】图解国网公司反违章工作通报（2022年第30期上）_4.jpg\",\"fileType\":\"jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/13/rBDYiWPp4DeATHDWAAVnQdBS6Is188.jpg\",\"fileSize\":354113.00,\"delFlag\":\"0\",\"height\":1500,\"width\":2666}]},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:01:55\",\"params\":{},\"fileId\":\"ff072e4993d84b96aa3bc2badc65aec3\",\"fileName\":\"人员分工.xlsx\",\"fileType\":\"xlsx\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4GKAJZ7tAANnwh64nHo11.xlsx\",\"fileSize\":223170.00,\"delFlag\":\"0\"},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:02:06\",\"params\":{},\"fileId\":\"f8f51ce6a3a244d9bf4abc10ec9d9250\",\"fileName\":\"安全融媒体需求及备注说明.docx\",\"fileType\":\"docx\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4G6AHOR1AAdHI3-cHS093.docx\",\"fileSize\":476963.00,\"delFlag\":\"0\"},{\"createBy\":\"softmedia\",\"createTime\":\"2023-02-13 15:08:07\",\"params\":{},\"fileId\":\"926e306024114d548afcc7445a46d3e6\",\"fileName\":\"111222333.mp4\",\"fileType\":\"mp4\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/14/rBDYiWPp4daAFcxnA30wVdFXi88193.mp4\",\"fileSize\":58536021.00,\"delFlag\":\"0\"}]}}";
//         text  = "{\"msg\":\"操作成功\",\"code\":200,\"data\":{\"cacheFileIds\":\"\",\"fileId\":\"8be449177bcc423587d9447bccb3653a\",\"files\":[{\"createBy\":\"softmedia\",\"createTime\":1678411927000,\"delFlag\":\"0\",\"fileId\":\"8be449177bcc423587d9447bccb3653a\",\"fileName\":\"3.10.pdf\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/1B/rBDYiWQKiJeAE3pyABg4OPWCMCw583.pdf\",\"fileSize\":1587256.00,\"fileType\":\"pdf\",\"params\":{},\"picFiles\":[{\"createBy\":\"softmedia\",\"createTime\":1678411925000,\"delFlag\":\"0\",\"fileId\":\"a94de38e73ff47ddaa39391c6176f0f2\",\"fileName\":\"3_1.jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/1A/rBDYiWQKiJSAWIr1AARebGzog0I493.jpg\",\"fileSize\":286316.00,\"fileType\":\"jpg\",\"height\":1653,\"params\":{},\"remark\":\"1\",\"width\":2338},{\"createBy\":\"softmedia\",\"createTime\":1678411925000,\"delFlag\":\"0\",\"fileId\":\"626472c130814a8e93f7c5ba8150d37f\",\"fileName\":\"3_2.jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/1A/rBDYiWQKiJSADSxMAAIv7aKv5Uk772.jpg\",\"fileSize\":143341.00,\"fileType\":\"jpg\",\"height\":1653,\"params\":{},\"remark\":\"2\",\"width\":2338},{\"createBy\":\"softmedia\",\"createTime\":1678411925000,\"delFlag\":\"0\",\"fileId\":\"c217e6c769ee46d7883270dbcf57936a\",\"fileName\":\"3_3.jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/1B/rBDYiWQKiJWABQM-AAQ8Uc7z-wg220.jpg\",\"fileSize\":277585.00,\"fileType\":\"jpg\",\"height\":1653,\"params\":{},\"remark\":\"3\",\"width\":2338},{\"createBy\":\"softmedia\",\"createTime\":1678411926000,\"delFlag\":\"0\",\"fileId\":\"44e3d715dab24d11a381df6b9c706fb4\",\"fileName\":\"3_4.jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/1B/rBDYiWQKiJWAcmk9AAYvx1F5h80416.jpg\",\"fileSize\":405447.00,\"fileType\":\"jpg\",\"height\":1653,\"params\":{},\"remark\":\"4\",\"width\":2338},{\"createBy\":\"softmedia\",\"createTime\":1678411926000,\"delFlag\":\"0\",\"fileId\":\"d66672ca18da4683b23b35ca835a2125\",\"fileName\":\"3_5.jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/1B/rBDYiWQKiJWATEw1AAZVCYRTV8U486.jpg\",\"fileSize\":414985.00,\"fileType\":\"jpg\",\"height\":1653,\"params\":{},\"remark\":\"5\",\"width\":2338},{\"createBy\":\"softmedia\",\"createTime\":1678411926000,\"delFlag\":\"0\",\"fileId\":\"8a55f40fbd6e4b169ec686519438fd1b\",\"fileName\":\"3_6.jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/1B/rBDYiWQKiJaAFd8CAADyFMjMfq8703.jpg\",\"fileSize\":61972.00,\"fileType\":\"jpg\",\"height\":1653,\"params\":{},\"remark\":\"6\",\"width\":2338},{\"createBy\":\"softmedia\",\"createTime\":1678411926000,\"delFlag\":\"0\",\"fileId\":\"b3f6a6c89df94dc29eec57bc6028295c\",\"fileName\":\"3_7.jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/1B/rBDYiWQKiJaASLZSAAUMODBm9G4584.jpg\",\"fileSize\":330808.00,\"fileType\":\"jpg\",\"height\":1653,\"params\":{},\"remark\":\"7\",\"width\":2338},{\"createBy\":\"softmedia\",\"createTime\":1678411926000,\"delFlag\":\"0\",\"fileId\":\"68e87d2f6f1641e48c428246b16d43e2\",\"fileName\":\"3_8.jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/1B/rBDYiWQKiJaABdYDAAUCfv98Tdk698.jpg\",\"fileSize\":328318.00,\"fileType\":\"jpg\",\"height\":1653,\"params\":{},\"remark\":\"8\",\"width\":2338},{\"createBy\":\"softmedia\",\"createTime\":1678411927000,\"delFlag\":\"0\",\"fileId\":\"ef81a2fb8a5d4f4c8378ac4d905346dc\",\"fileName\":\"3_9.jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/1B/rBDYiWQKiJaAVcv1AAVdyso8dxQ551.jpg\",\"fileSize\":351690.00,\"fileType\":\"jpg\",\"height\":1653,\"params\":{},\"remark\":\"9\",\"width\":2338},{\"createBy\":\"softmedia\",\"createTime\":1678411927000,\"delFlag\":\"0\",\"fileId\":\"51b6725d5692422fa8fee791665251ed\",\"fileName\":\"3_10.jpg\",\"filePath\":\"http://218.6.242.123:18000/group1/M00/00/1B/rBDYiWQKiJeADXJcAAUAeYROGkU456.jpg\",\"fileSize\":327801.00,\"fileType\":\"jpg\",\"height\":1653,\"params\":{},\"remark\":\"10\",\"width\":2338}]}],\"materialId\":409,\"order\":[{\"fileId\":\"8be449177bcc423587d9447bccb3653a\",\"fileName\":\"3.10.pdf\",\"fileType\":\"pdf\",\"materialId\":409,\"onTop\":\"0\",\"playEndTime\":\"23:59:59\",\"playStartTime\":\"00:00\"}],\"range\":[],\"terminalId\":459,\"top\":[]}}";
        try {
            result = GsonFactory.getSingletonGson().fromJson(text, type);
        } catch (JsonSyntaxException e) {
            // 返回结果读取异常
            throw new DataException(mApplication.getString(R.string.http_data_explain_error), e);
        }

        if (result instanceof HttpData) {
            HttpData<?> model = (HttpData<?>) result;

            if (model.isRequestSucceed()) {
                // 代表执行成功
                return result;
            }

            if (model.isTokenFailure()) {
                // 代表登录失效，需要重新登录
                throw new TokenException(mApplication.getString(R.string.http_token_error));
            }

            // 代表执行失败
            throw new ResultException(model.getMessage(), model);
        }
        return result;
    }

    @NonNull
    @Override
    public Exception requestFail(@NonNull HttpRequest<?> httpRequest, @NonNull Exception e) {
        if (e instanceof HttpException) {
            if (e instanceof TokenException) {
                // 登录信息失效，跳转到登录页

            }
            return e;
        }

        if (e instanceof SocketTimeoutException) {
            return new TimeoutException(mApplication.getString(R.string.http_server_out_time), e);
        }

        if (e instanceof UnknownHostException) {
            NetworkInfo info = ((ConnectivityManager) mApplication.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();
            // 判断网络是否连接
            if (info != null && info.isConnected()) {
                // 有连接就是服务器的问题
                return new ServerException(mApplication.getString(R.string.http_server_error), e);
            }
            // 没有连接就是网络异常
            return new NetworkException(mApplication.getString(R.string.http_network_error), e);
        }

        if (e instanceof IOException) {
            return new CancelException(mApplication.getString(R.string.http_request_cancel), e);
        }

        return new HttpException(e.getMessage(), e);
    }

    @NonNull
    @Override
    public Exception downloadFail(@NonNull HttpRequest<?> httpRequest, @NonNull Exception e) {
        if (e instanceof ResponseException) {
            ResponseException responseException = ((ResponseException) e);
            Response response = responseException.getResponse();
            responseException.setMessage(String.format(mApplication.getString(R.string.http_response_error),
                    response.code(), response.message()));
            return responseException;
        } else if (e instanceof NullBodyException) {
            NullBodyException nullBodyException = ((NullBodyException) e);
            nullBodyException.setMessage(mApplication.getString(R.string.http_response_null_body));
            return nullBodyException;
        } else if (e instanceof FileMD5Exception) {
            FileMD5Exception fileMd5Exception = ((FileMD5Exception) e);
            fileMd5Exception.setMessage(mApplication.getString(R.string.http_response_md5_error));
            return fileMd5Exception;
        }
        return requestFail(httpRequest, e);
    }

    @Nullable
    @Override
    public Object readCache(@NonNull HttpRequest<?> httpRequest, @NonNull Type type, long cacheTime) {
//        String cacheTimeKey = HttpCacheManager.generateCacheKey(httpRequest);
//        String cacheValue = HttpCacheManager.getMmkv().getString(cacheKey, null);
//        if (cacheValue == null || "".equals(cacheValue) || "{}".equals(cacheValue)) {
//            return null;
//        }
//        EasyLog.printLog(httpRequest, "----- readCache cacheKey -----");
//        EasyLog.printJson(httpRequest, cacheKey);
//        EasyLog.printLog(httpRequest, "----- readCache cacheValue -----");
//        EasyLog.printJson(httpRequest, cacheValue);
//        return GsonFactory.getSingletonGson().fromJson(cacheValue, type);
        return null;
    }

    @Override
    public boolean writeCache(@NonNull HttpRequest<?> httpRequest, @NonNull Response response, @NonNull Object result) {
//        String cacheKey = HttpCacheManager.generateCacheKey(httpRequest);
//        String cacheValue = GsonFactory.getSingletonGson().toJson(result);
//        if (cacheValue == null || "".equals(cacheValue) || "{}".equals(cacheValue)) {
//            return false;
//        }
//        EasyLog.printLog(httpRequest, "----- writeCache cacheKey -----");
//        EasyLog.printJson(httpRequest, cacheKey);
//        EasyLog.printLog(httpRequest, "----- writeCache cacheValue -----");
//        EasyLog.printJson(httpRequest, cacheValue);
//        return HttpCacheManager.getMmkv().putString(cacheKey, cacheValue).commit();
        return false;
    }

    @Override
    public void clearCache() {
//        HttpCacheManager.getMmkv().clearMemoryCache();
//        HttpCacheManager.getMmkv().clearAll();
    }
}